package com.galeno.javabasic;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.RichSourceFunction;
import org.apache.flink.streaming.runtime.io.StreamInputProcessor;

/**
 * @author galeno
 * @Title:
 * @Description:
 * @date 2021/10/3022:15
 */
public class 分布式缓存 {
    public static void main(String[] args) {
        Configuration configuration = new Configuration();
        configuration.setInteger("rest.port",10086);
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(configuration);
        //分布式缓存
        env.registerCachedFile("hdfs://a","a",true);

        RichSourceFunction<String> stringRichSourceFunction = new RichSourceFunction<String>() {
            @Override
            public void open(Configuration parameters) throws Exception {
                getRuntimeContext().getDistributedCache().getFile("a");
            }

            @Override
            public void run(SourceContext ctx) throws Exception {

            }

            @Override
            public void cancel() {

            }
        };


    }
}
